package com.ruibang.glass.produce.controller.system;

import com.ruibang.glass.produce.domain.req.UserPersonalizedStyleReq;
import com.ruibang.glass.produce.service.UserPersonalizedStyleService;
import com.teaming.cloud.framework2.common.model.ResultBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: songJinKang
 * @CreateTime: 2024-01-31  20:12
 * @Description: TODO：用户个性化样式控制器
 * @Version: 1.0
 */

@Slf4j
@Api(tags = "用户个性化样式控制器")
@RequestMapping("/api/glass/produce/userPersonalizedStyle")
@RestController
public class UserPersonalizedStyleController {

    @Autowired
    private UserPersonalizedStyleService userPersonalizedStyleService;

    @GetMapping("/get/{key}")
    @ApiOperation(value = "获取用户个性化样式", response = ResultBody.class)
    public ResultBody save(@PathVariable String key) {
        return userPersonalizedStyleService.get(key);
    }

    @PostMapping("/set")
    @ApiOperation(value = "保存用户个性化样式", response = ResultBody.class)
    public ResultBody save(@RequestBody UserPersonalizedStyleReq userPersonalizedStyleReq) {
        return userPersonalizedStyleService.set(userPersonalizedStyleReq);
    }

}
